<a href="<?php echo base_url().'poster_admin/college/create'?>"><button type="button" class="btn btn-primary btn-lg upload-button">添加学院</button></a>
<h1 id="titlename">学院列表</h1>
<?php
if (!empty($query)) {

foreach($query as $value) {
    echo '<div class="clear"><div class="panel panel-default">
             <div class="panel-body">';
    echo '<p class="lead left-side">'.$value['name'].'</p>';
    echo '<div class="right-side">';
    echo '<a href="'.base_url().'poster_admin/college/edit?id='.$value['id'].'"><button type="button" class="btn btn-primary">修改</button></a> ';
    echo '<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#Delete'.$value['id'].'">删除</button>';
    echo '</div>';
    ?>
    <div class="modal fade" id="Delete<?php echo $value['id'] ?>" tabindex="-1" role="dialog" aria-labelledby="Del<?php echo $value['id'] ?>" aria-hidden="true">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                    <h4 class="modal-title" id="Del<?php echo $value['id'] ?>">确认删除？</h4>
                </div>
                <div class="modal-body">
                    <p>您是否要删除（删除操作不可逆，一旦删除，无法恢复，请谨慎操作）：<strong><?php echo $value['name'] ?></strong></p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
                    <?php     echo '<a href="'.base_url().'poster_admin/college/delete?id='.$value['id'].'"><button type="button" class="btn btn-danger">删除</button></a>' . '<br/>'; ?>
                </div>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div><!-- /.modal -->
    <?php
    echo '</div></div></div>';
}
} else {
    echo '<div class="clear"><div class="alert alert-danger">目前还没有任何学院的样子，请先添加</div></div>';
}
?>